package com.jc.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.jc.model.User;
import com.jc.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

@Scope("prototype")
@Controller("userAction")
public class UserAction extends ActionSupport{
	@Resource
	private UserService userService;
	private List<User> users;
	//这样页面就能获取到数据了
	public List<User> getUsers() {
		return users;
	}
	public String index(){
		 this.users = userService.getAllUser();
		 System.out.println(users.size());
		return "yes";
	}
}
